package com.antlr4.app;

import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.TerminalNode;

/**
 * @Author xiongmin
 * @Description TODO
 * @Date 2019/11/18 17:58
 * @Version 1.0
 **/
public class MyListen implements Antlr4TestListener {
    @Override
    public void enterStart(Antlr4TestParser.StartContext ctx) {
        System.out.println(ctx.HI().getText());
        System.out.println(ctx.ID());
    }

    @Override
    public void exitStart(Antlr4TestParser.StartContext ctx) {
        System.out.println("stat节点访问完毕");
    }

    @Override
    public void enterString(Antlr4TestParser.StringContext ctx) {

    }

    @Override
    public void exitString(Antlr4TestParser.StringContext ctx) {

    }

    @Override
    public void visitTerminal(TerminalNode terminalNode) {

    }

    @Override
    public void visitErrorNode(ErrorNode errorNode) {

    }

    @Override
    public void enterEveryRule(ParserRuleContext parserRuleContext) {

    }

    @Override
    public void exitEveryRule(ParserRuleContext parserRuleContext) {

    }
}
